package com.bjpowernode.springboot.web;

import com.bjpowernode.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping(value = "/put")
    @ResponseBody
    public Object put(String key,String value){
        studentService.put(key,value);
        return "值以成功放入redis";
    }

    @RequestMapping(value = "/get")
    @ResponseBody
    public String get(String key){
        String value = studentService.get(key);
       return "数量count为：" + value;
    }



}
